<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var txuedanjia=245;
			var txueshuing=2;
			var wangqiuxiedanjia=570;
			var wangqiuxieshuliang=10;
			var wangqiupaidanjia=320;
			var wangqiupaishuliang=1;
			
			document.write("<table  width='300px' align='center'>");
			document.write("<tr >");
			document.write("<td colspan='4' align='center'> ");
			document.write("********消费单********");
			document.write("</td>");
			document.write("</tr>");			
			document.write("<tr >");
			document.write("<td  > ");
			document.write("购买物品");
			document.write("</td>");
			document.write("<td  > ");
			document.write("单价");
			document.write("</td>");
			document.write("<td  > ");
			document.write("数量");
			document.write("</td>");
			document.write("<td  > ");
			document.write("金额");
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr >");
			document.write("<td  > ");
			document.write("T恤");
			document.write("</td>");
			document.write("<td  > ");
			document.write("&yen;"+(txuedanjia));
			document.write("</td>");
			document.write("<td  > ");
			document.write(txueshuing);
			document.write("</td>");
			document.write("<td  > ");
			document.write("&yen;"+(txuedanjia*txueshuing));
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr >");
			document.write("<td  > ");
			document.write("网球鞋");
			document.write("</td>");
			document.write("<td  > ");
			document.write("&yen;"+(wangqiuxiedanjia));
			document.write("</td>");
			document.write("<td  > ");
			document.write(wangqiuxieshuliang);
			document.write("</td>");
			document.write("<td  > ");
			document.write("&yen;"+(wangqiuxiedanjia*wangqiuxieshuliang));
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr >");
			document.write("<td  > ");
			document.write("网球拍");
			document.write("</td>");
			document.write("<td  > ");
			document.write("&yen;"+(wangqiupaidanjia));
			document.write("</td>");
			document.write("<td  > ");
			document.write(wangqiupaishuliang);
			document.write("</td>");
			document.write("<td  > ");
			document.write("&yen;"+(wangqiupaidanjia*wangqiupaishuliang));
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr >");
			document.write("<td colspan='4' align='center'> ");
			document.write("&nbsp;");
			document.write("</td>");
			document.write("</tr>");
			
			var price=0.8;
			document.write("<tr >");
			document.write("<td > ");
			document.write("折扣：");
			document.write("</td>");
			document.write("<td  colspan='3'> ");
			document.write(price*10+"折");
			document.write("</td>");
			document.write("</tr>");
			var zong=(txuedanjia*txueshuing)+(wangqiuxiedanjia*wangqiuxieshuliang)+(wangqiupaidanjia*wangqiupaishuliang);
			document.write("<tr >");
			document.write("<td > ");
			document.write("消费总金额：");
			document.write("</td>");
			document.write("<td  colspan='3'> ");
			document.write("&yen;"+zong*price);
			document.write("</td>");
			document.write("</tr>");
			var shiji=5300;
			document.write("<tr >");
			document.write("<td > ");
			document.write("实际交费：");
			document.write("</td>");
			document.write("<td  colspan='3'> ");
			document.write("&yen;"+shiji);
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr >");
			document.write("<td > ");
			document.write("找零：");
			document.write("</td>");
			document.write("<td  colspan='3'> ");
			document.write("&yen;"+(shiji-zong*price));
			document.write("</td>");
			document.write("</tr>");
			
			document.write("</table>");
		</script>
	</head>
	
</html>
